Fix Ad Hoc Profiling View Rendering Issue#62
Merged
artursarlo merged 2 commits intomasterfrom Jan 21, 2026
Merged
Conversation
prashantbytesyntax
approved these changes
Jan 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix Ad Hoc Profiling View Rendering Issue
Overview
This PR fixes a bug where the Ad Hoc Profiling view was blocked from rendering when flamegraph data was unavailable or when the
api/metrics/nodes_cores/summaryendpoint failed. The fix ensures the Ad Hoc view is always accessible since it operates independently from continuous flamegraph data.Problem Statement
The Ad Hoc Profiling view was experiencing the following issues:
isFGEmpty = true), even though Ad Hoc profiling has its own data sourcenodes_cores/summaryAPI endpoint, which is unrelated to Ad Hoc profilingisFGEmpty = true(due to no flamegraph data), then switching back to Flamegraph view would show the wrong empty state messageRoot Cause Analysis
The rendering logic had multiple blocking layers:
isFgDisplayed(based on flamegraph data availability) before rendering any viewsisFgDisplayedagain before renderingProfilesViewsProfilesEmptyStatewhenisFGEmpty = trueisFGEmptystate regardless of view mode, polluting state when switching viewsSolution
1. Wrapper Layer Fixes
Files Modified:
src/gprofiler/frontend/src/components/profiles/ProfilesWrapper.jsxsrc/gprofiler/frontend/src/components/profiles/ProfilesViewsWrapper.jsxChanges:
shouldShowView/shouldDisplayViewvariables that evaluate totruewhen either:isFgDisplayed), ORviewMode === PROFILES_VIEWS.adhoc)2. View Rendering Order Fix
File Modified:
src/gprofiler/frontend/src/components/profiles/ProfilesViews.jsxChanges:
isFGEmptychecks3. State Management Fix
File Modified:
src/gprofiler/frontend/src/components/profiles/ProfilesViews.jsxChanges:
isFGEmptyupdate effect to only run for views that depend on flamegraph data4. UI Enhancement: Collapsible File List
File Modified:
src/gprofiler/frontend/src/components/profiles/views/adhoc/AdhocProfilingView.jsxNew Features:
grey.100) on the header bargrey.200) to indicate interactivityTechnical Details
View Independence Matrix
Rendering Flow After Fix
Benefits
isFGEmptystateTesting
Test Scenarios Verified
nodes_cores/summaryendpoint failsBrowser Testing
Migration Notes
Files Changed
Frontend Files
src/gprofiler/frontend/src/components/profiles/ProfilesWrapper.jsx
SelectorsContextandPROFILES_VIEWSimportsviewModefrom contextshouldShowViewlogic for Ad Hoc bypasssrc/gprofiler/frontend/src/components/profiles/ProfilesViewsWrapper.jsx
isAdhocViewcheckshouldDisplayViewlogicsrc/gprofiler/frontend/src/components/profiles/ProfilesViews.jsx
isFGEmptyeffect to exclude Ad Hoc viewsrc/gprofiler/frontend/src/components/profiles/views/adhoc/AdhocProfilingView.jsx
Collapse,Icon, andICONS_NAMESimportsisTableExpandedstate